#include "./../includes/ordena.h"

/***************************
 *
 *   Public methods
 *
 ***************************/

stackOrdenate::stackOrdenate()
{
	this->toOrder = new pilha<int>;
	this->ordered = new lista<int>;
}

stackOrdenate::~stackOrdenate()
{
	delete this->toOrder;
	delete this->ordered;
}

void
stackOrdenate::addNumber(int _number)
{
	this->toOrder->push(_number);
}

void
stackOrdenate::addStack(pilha<int> _pilha )
{
	while(! _pilha.isEmpty() )
	{
		this->addNumber( _pilha.getInfo() );
		_pilha.pop();
	}
}

void
stackOrdenate::order()
{


}

std::string
stackOrdenate::getOrdered()
{
	while (!this->toOrder->isEmpty())
	{
		int temp = this->toOrder->getInfo();
		
		this->setPlace(temp);
		
		this->toOrder->pop();
	}
	
	std::string
	ret = "sdklfh";
	
	return ret;
}

/****************************************
 * 
 *    Protected Methods
 * 
 * **************************************/

void
stackOrdenate::setPlace(int& _number)
{
	if( this->ordered->isEmpty() )
	{
		this->ordered->push( _number );
	}
	
}
